package com.pdg.mcplugin.simpleconomy.dataproviders;

import java.io.File;

import com.pdg.mcplugin.common.baseclasses.DataProviderBase;
import com.pdg.mcplugin.simpleconomy.SimplEconomy;
import com.pdg.mcplugin.simpleconomy.dataproviders.accounts.AccountTableProvider;
import com.pdg.mcplugin.simpleconomy.dataproviders.bankmembers.BankMemberTableProvider;
import com.pdg.mcplugin.simpleconomy.dataproviders.banks.BankTableProvider;

public class DataProvider extends DataProviderBase<SimplEconomy> {

	private static final String CONNECTION_STRING = "jdbc:sqlite:%s"+ File.separator + "simpleconomy.db";
	
	private AccountTableProvider accountTableProvider = null;
	public AccountTableProvider getAccountTableProvider(){
		if(accountTableProvider==null){
			accountTableProvider = new AccountTableProvider(this);
		}
		return accountTableProvider;
	}
	private BankMemberTableProvider bankMemberTableProvider = null;
	public BankMemberTableProvider getBankMemberTableProvider(){
		if(bankMemberTableProvider==null){
			bankMemberTableProvider = new BankMemberTableProvider(this);
		}
		return bankMemberTableProvider;
	}
	private BankTableProvider bankTableProvider = null;
	public BankTableProvider getBankTableProvider(){
		if(bankTableProvider==null){
			bankTableProvider = new BankTableProvider(this);
		}
		return bankTableProvider;
	}

	public DataProvider(SimplEconomy thePlugin) {
		super(thePlugin, CONNECTION_STRING);
	}

}
